package com.wb.structual.proxy.jdk;

import java.lang.reflect.Proxy;

/**
 * @author 魏彪
 */
public class Client {
    public static void main(String[] args) {
        AbstractUserDao userDao = new UserDao();
        LogHandler logHandler = new LogHandler(userDao);
        AbstractUserDao proxy = (AbstractUserDao) Proxy.newProxyInstance(AbstractUserDao.class.getClassLoader(), new Class[]{AbstractUserDao.class}, logHandler);
        proxy.findUserById("杨过");
        System.out.println("----------------------------------");
    }
}
